import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * 给定n个字符串，请对n个字符串按照字典序排列。
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei014 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            int n=Integer.parseInt(scanner.nextLine());
            List<String> list=new ArrayList<>();
            while (n>0){
                list.add(scanner.nextLine());
                n--;
            }
            Collections.sort(list);
            for(String s:list){
                System.out.println(s);
            }
        }
        scanner.close();
    }
}